<html>
<head><meta charset="utf-8"><title>vscode 100% cpu · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode.20100.25.20cpu.html">vscode 100% cpu</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="236414664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode%20100%25%20cpu/near/236414664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tdelabro <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode.20100.25.20cpu.html#236414664">(Apr 27 2021 at 21:36)</a>:</h4>
<p>Hey, I'm using vscode with the rust-anlayzer and each time I run <code>x check</code> the whole app freeze for a dozen of seconds after the execution is done, and the fan start making a lot of noise. I'm using mac os. Is there a way to avoid this ?<br>
<a href="/user_uploads/4715/PeD6fBV9zK2OzVSVs88FSst4/Screenshot-2021-04-26-at-22.21.17.png">Screenshot-2021-04-26-at-22.21.17.png</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/PeD6fBV9zK2OzVSVs88FSst4/Screenshot-2021-04-26-at-22.21.17.png" title="Screenshot-2021-04-26-at-22.21.17.png"><img src="/user_uploads/4715/PeD6fBV9zK2OzVSVs88FSst4/Screenshot-2021-04-26-at-22.21.17.png"></a></div>



<a name="236455995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode%20100%25%20cpu/near/236455995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode.20100.25.20cpu.html#236455995">(Apr 28 2021 at 06:18)</a>:</h4>
<p>Did you disable "check on save" in RA? That <code>rustc</code> process is either started by RA (for "check on save"), or by your <code>./x.py check</code>. The other one (Code Renderer) is unrelated, does Code show anything new (maybe a lot of errors) when it starts working again?</p>



<a name="236456352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode%20100%25%20cpu/near/236456352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode.20100.25.20cpu.html#236456352">(Apr 28 2021 at 06:23)</a>:</h4>
<p>And can you also keep an eye on the available RAM?</p>



<a name="236480595"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode%20100%25%20cpu/near/236480595" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tdelabro <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode.20100.25.20cpu.html#236480595">(Apr 28 2021 at 10:02)</a>:</h4>
<p>Yes I disabled the check on save for RA. After some research I figured out that it was a common problem for vscode when working on huge repos (<a href="https://github.com/Microsoft/vscode/issues/3998">https://github.com/Microsoft/vscode/issues/3998</a>) and the only workaround was to exclude files from watch. So I added:</p>
<div class="codehilite" data-code-language="JSON"><pre><span></span><code>  <span class="nt">"files.watcherExclude"</span><span class="p">:</span> <span class="p">{</span>
    <span class="nt">"**/build/**"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
    <span class="nt">"**/node_modules/**"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
    <span class="nt">"**/src/test/**"</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
  <span class="p">}</span>
</code></pre></div>
<p>to my settings.json and it's usable again. The pike over 100% cpu only last for less than a second now.<br>
There is probably  other folders I can exclude without ruining the coding experience.</p>



<a name="236482157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vscode%20100%25%20cpu/near/236482157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vscode.20100.25.20cpu.html#236482157">(Apr 28 2021 at 10:15)</a>:</h4>
<p>heh, file watching is an unsolved problem. Porting <code>watchman</code>'s design to Rust, such that it can work both as an external service and as a library, would be a big deal</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>